package com.xuanl.protagonist.controller.robot;

import com.xuanl.protagonist.dto.ProPersonRobotDo;
import com.xuanl.protagonist.service.robot.ProPersonRobotService;
import com.xuanl.protagonist.vo.ProPersonRobotVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import protagonist.annotation.LimitReq;
import protagonist.common.pojo.CommonResult;

import java.util.List;

/**
 * @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
 */
@RestController
@RequestMapping("/app/robot")
@Slf4j
public class ProPersonRobotController {

    public ProPersonRobotController(ProPersonRobotService robotService) {
        this.robotService = robotService;
    }

    private ProPersonRobotService robotService;

    /**
     * 列表查询
     *
     * @param proPersonRobotVo
     * @return
     */
    @GetMapping("/list")
    @LimitReq(count = 10,time = 60)
    public CommonResult<List<ProPersonRobotDo>> login(ProPersonRobotVo proPersonRobotVo) {
        List<ProPersonRobotDo> robotDos = robotService.getList(proPersonRobotVo);
        return CommonResult.success(robotDos);
    }

}
